<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<body>
	<!-- <form action="http://localhost:5550/user/login?verifyType=image&requestSource=pc" method="post"> -->
	<form action="http://localhost:5550/user/login?verifyType=sms&requestSource=pc" method="post">
		<input id="username" name="username"maxlength="32" type="text" placeholder="请输入用户名" /><br> 
		<input id="password" name="password" type="password" maxlength="16"
			placeholder="请出入密码" /> <br>
		<input type="text" name="image" placeholder="请出入验证码">
		<!-- <input type="text" name="sms" placeholder="请出入验证码"> -->
		<img id="imageCode" src="http://localhost:5550/user/getCode/image?requestSource=pc" />
		<input type="button"  id="smsCode" value="发送短信" />
		<input type="submit" name="登录">
	</form>
	
	<!-- <input type="button" name="登录" value="登录" id="login"> -->
	<script type="text/javascript" src="../plugins/jquery.min.js"></script>
	<script type="text/javascript">
		$(function() {
			// $("#login").click(function() {
			// 	$.ajax({
			// 		type : "post",
			// 		url : "http://localhost:5550/user/login",
			// 		data : {
			// 			username : "admin",
			// 			password : "123456"
			// 		},
			// 		success : function(data) {
			// 			alert(data);
			// 		}
			// 	});
			// });
			$("#imageCode").trigger("click");
			$("#imageCode").click(function(){
				$(this).attr("src","http://localhost:5550/user/getCode/image?requestSource=pc&_t="+new Date().getTime());
			});
			$("#smsCode").click(function(){
				$.ajax({
					type:"get",
					url:"http://localhost:5550/user/getCode/sms?requestSource=pc&mobile=13456789876&_t="+new Date().getTime(),
					success:function(data){
						console.log(data);
					}
				});
			});
		})
	</script>
</body>
</html>